
import { FormType } from "../../UIFrame/config/SysDefine";
import { Event_Name, GEventManager } from "../../UIFrame/GEventManager";
import UIBase from "../../UIFrame/UIBase";
import UIManager from "../../UIFrame/UIManager";
import MenuLeftUI from "./MenuLeftUI";
import MenuRightUI from "./MenuRightUI";

const { ccclass, property } = cc._decorator;

@ccclass
export default class HallUI extends UIBase {

    static prefabPath = "prefabs/UIForms/HallUI";
    public formType = FormType.Screen;

    public canDestory = true;

    async load() {
        await UIManager.getInstance().loadUIForms(MenuLeftUI, MenuRightUI);
    }

    async onShow() {
        await Promise.all([MenuLeftUI.openView(), MenuRightUI.openView()]);
    }

    // onLoad () {}

    onEnable() {
        GEventManager.on(Event_Name.GAME_REFRESH_GOLD, this.refreshGold, this);
    }

    start() {

    }

    refreshGold() {
        cc.log('refreshGold');
    }

    // update (dt) {}

    onDisable() {
        GEventManager.off(Event_Name.GAME_REFRESH_GOLD, this.refreshGold, this);
    }
}
